const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
    transpileDependencies: true,
    pages: {
        index: {
            entry: 'src/main.js',
            template: 'public/index.html',
            filename: 'index.html',
        },
        login: {
            entry: 'src/login.js',
            template: 'public/login.html',
            filename: 'login.html'
        },
        admin:{
            entry: 'src/admin.js',
            template: 'public/admin/admin.html',
            filename: 'admin/admin.html'
        },
        edit:{
            entry: 'src/articleEdit.js',
            template: 'public/edit/article_edit.html',
            filename: 'edit/article_edit.html'
        },
        article:{
            entry: 'src/viewJS/article.js',
            template: 'public/article.html',
            filename: 'article.html'
        },
        activity:{
            entry: 'src/viewJS/activity.js',
            template: 'public/activity.html',
            filename: 'activity.html'
        }
    },
    devServer: {
        host: '0.0.0.0',//表示任意ip地址
        port: 8080,
        proxy: {
            '/': {//前端请求路径路径
                ws: false,//不配置出现WebSocket connection to 'ws://...' failed: Invalid frame header的错误
                target: 'http://localhost:8080',//目标服务器地址
                changeOrigin: true,//允许跨域
            }
        }
    }
})
